<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*块级作用域*/
    if (true) {
        let res = 10;
    }
    console.log(res)

    /*必须先声明然后使用*/
    let num = 10
    console.log(num)

    /*不能重复声明*/
    // 以下操作会报错
    let a = 10
    let a = 30
    console.log(a)
</script>
</body>
</html>